$(function() {
$("#checkAll").click(function() {
$('input[name="qid[]"]').attr("checked",this.checked); 
});
var $xid = $("input[name='qid[]']");
$xid.click(function(){
$("#checkAll").attr("checked",$xid.length == $("input[name='qid[]']:checked").length ? true : false);
});
});

function openaddqq(){
art.dialog.open('../pages/add.php', {
	id: 'Xg1',
	title: '添加挂机记录',
    width:260,
    height:120,
    padding:0,
    margin:0,
    close: function(){
    	location.reload();
    }
	});
}

function delbutton(){

art.dialog({
	id: 'Xg2',
	title: '信息确认框',
	icon: 'error',
	content: '您确定要删除所选吗?',
    ok: function () {
    document.getElementById("delqq").submit()
    },
    cancelVal: '关闭',
    cancel: true 
});

}

function batchaddqq()
{

art.dialog.open('../pages/batch.php', {
	id: 'Xg3',
	title: '批量添加记录',
    width:800,
    height:500,
    padding:0,
    margin:0,
    fixed: true,
    drag: false,
    close: function(){
    	location.reload();
    }
	});


}



function startTime() {
var now=new Date();
var year=now.getFullYear();
var month=now.getMonth()+1;
var day=now.getDate();
var hours=now.getHours();
var minutes=now.getMinutes();
var seconds=now.getSeconds();
hours=checkTime(hours);
minutes=checkTime(minutes);
seconds=checkTime(seconds);
document.getElementById("Racetimes").innerHTML=" "+hours+":"+minutes+":"+seconds;
setTimeout(startTime, 500)
}

function checkTime(i)
{
if (i<10) 
  {i="0" + i}
  return i
}